﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace hyjiacan.util.web.wp
{
    public partial class PostForm : hyjiacan.util.winform.JForm
    {
        public PostForm(string title)
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;
        }

        private void PostForm_Load(object sender, EventArgs e)
        {
            backgroundWorker.RunWorkerAsync();
        }

        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {

            DataTable data = new WPData().GetPosts();
            Invoke((MethodInvoker)delegate()
            {
                grid.DataSource = data;
            });

        }

        private void grid_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            
        }
    }
}
